import { MessageItem } from '@/app/types/Chat'
import { MessageRoleEnum } from '@/configs/enums'

interface MessageBoxProps {
  message: MessageItem
}

export default function MessageBox({ message }: MessageBoxProps) {
  console.log(message)

  if (message.role === MessageRoleEnum.ASSISTANT) {
    return (
      <div>
        <p>{message.content}</p>
      </div>
    )
  }

  return (
    <div className="flex justify-end mb-4">
      <p className="rounded-lg bg-blue-500 text-white p-2">{message.content}</p>
    </div>
  )
}
